package com.emergency.direct.dao;

import com.emergency.base.domain.PlanDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface PlanDetailDao extends JpaRepository<PlanDetail, Long>, JpaSpecificationExecutor<PlanDetail> {
    void deleteByPlanId(Long id);

    @Query("select pd from PlanDetail pd where plan.id=:planId")
    List<PlanDetail> findAllByPlan(@Param("planId") Long planId);
}
